home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Q-R / RPN Calculator.cpt / RPN Calculator / card_4669.txt < prev    next >
Text File  |  1988-09-16  |  5KB  |  294 lines

  1. -- card: 4669 from stack: in
  2. -- bmap block id: 5959
  3. -- flags: 4000
  4. -- background id: 4132
  5. -- name: PG
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global synch
  9.   put 1 into synch
  10.   put "X" into card field synch
  11. end openCard
  12.  
  13.  
  14.  
  15. -- part 2 (button)
  16. -- low flags: 00
  17. -- high flags: A003
  18. -- rect: left=35 top=145 right=167 bottom=135
  19. -- title width / last selected line: 0
  20. -- icon id / first selected line: 0 / 0
  21. -- text alignment: 1
  22. -- font id: 0
  23. -- text size: 12
  24. -- style flags: 0
  25. -- line height: 16
  26. -- part name: Numbers
  27. ----- HyperTalk script -----
  28. on mouseUp
  29.   ask "Number steps to:" with last word in field "Step#"
  30.   if it < 0 or it > 999 then
  31.     exit mouseUp
  32.   end if
  33.   set the cursor to 4
  34.   put 1 into field "Step#"
  35.   put 2 into i
  36.   repeat until i > it
  37.     put Return & i after last line in field "Step#"
  38.     put i + 1 into i
  39.   end repeat
  40. end mouseUp
  41.  
  42.  
  43.  
  44. -- part 3 (button)
  45. -- low flags: 00
  46. -- high flags: A003
  47. -- rect: left=357 top=95 right=118 bottom=471
  48. -- title width / last selected line: 0
  49. -- icon id / first selected line: 0 / 0
  50. -- text alignment: 1
  51. -- font id: 0
  52. -- text size: 12
  53. -- style flags: 0
  54. -- line height: 16
  55. -- part name: Load Program
  56. ----- HyperTalk script -----
  57. on mouseUp
  58.   -- ask "Load what program?" with "Program"
  59.   -- Comment the next step and un-comment the above if you do not have
  60.   -- the "filename" XFCN
  61.   put filename() into it
  62.   if it is empty then exit mouseUp
  63.   put it into fileName
  64.   open file fileName
  65.   read from file fileName until tab
  66.   put empty into last char of it
  67.   put it into field "list"
  68.   close file fileName
  69. end mouseUp
  70.  
  71.  
  72.  
  73. -- part 4 (button)
  74. -- low flags: 00
  75. -- high flags: A003
  76. -- rect: left=356 top=132 right=154 bottom=472
  77. -- title width / last selected line: 0
  78. -- icon id / first selected line: 0 / 0
  79. -- text alignment: 1
  80. -- font id: 0
  81. -- text size: 12
  82. -- style flags: 0
  83. -- line height: 16
  84. -- part name: Save Program
  85. ----- HyperTalk script -----
  86. on mouseUp
  87.   put line 1 of field "list" into fileName
  88.   ask "Export program to what file?" with fileName
  89.   if it is empty then exit mouseUp
  90.   put it into fileName
  91.   open file fileName
  92.   write field "list" to file fileName
  93.   write tab to file fileName
  94.   close file fileName
  95. end mouseUp
  96.  
  97.  
  98.  
  99. -- part 5 (button)
  100. -- low flags: 00
  101. -- high flags: A003
  102. -- rect: left=358 top=171 right=193 bottom=472
  103. -- title width / last selected line: 0
  104. -- icon id / first selected line: 0 / 0
  105. -- text alignment: 1
  106. -- font id: 0
  107. -- text size: 12
  108. -- style flags: 0
  109. -- line height: 16
  110. -- part name: Print Program
  111. ----- HyperTalk script -----
  112. on mouseUp
  113.   doMenu "Print Report..."
  114. end mouseUp
  115.  
  116.  
  117.  
  118. -- part 6 (button)
  119. -- low flags: 00
  120. -- high flags: 0000
  121. -- rect: left=51 top=276 right=312 bottom=112
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 2162 / 2162
  124. -- text alignment: 1
  125. -- font id: 0
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: Done
  130. ----- HyperTalk script -----
  131. on mouseUp
  132.   go to card "Calc"
  133.   send mouseUp to card button "Prg"
  134. end mouseUp
  135.  
  136.  
  137.  
  138. -- part 7 (button)
  139. -- low flags: 00
  140. -- high flags: 8003
  141. -- rect: left=358 top=212 right=234 bottom=475
  142. -- title width / last selected line: 0
  143. -- icon id / first selected line: 0 / 0
  144. -- text alignment: 1
  145. -- font id: 0
  146. -- text size: 12
  147. -- style flags: 0
  148. -- line height: 16
  149. -- part name: Clear Program
  150. ----- HyperTalk script -----
  151. on mouseUp
  152.   answer "Clear Program - Are you sure?" with "Yes" or "No"
  153.   if it is "Yes" then put empty into field "List"
  154. end mouseUp
  155.  
  156.  
  157.  
  158. -- part 8 (field)
  159. -- low flags: 01
  160. -- high flags: 0002
  161. -- rect: left=360 top=258 right=274 bottom=377
  162. -- title width / last selected line: 0
  163. -- icon id / first selected line: 0 / 0
  164. -- text alignment: 0
  165. -- font id: 3
  166. -- text size: 12
  167. -- style flags: 0
  168. -- line height: 16
  169. -- part name: Synch
  170. ----- HyperTalk script -----
  171. on mouseUp
  172.   global synch
  173.   if synch = 1 then
  174.     put 0 into synch
  175.     put empty into me
  176.   else
  177.     put 1 into synch
  178.     put "X" into me
  179.   end if
  180. end mouseUp
  181.  
  182.  
  183.  
  184. -- part contents for background part 2
  185. ----- text -----
  186. 1
  187. 2
  188. 3
  189. 4
  190. 5
  191. 6
  192. 7
  193. 8
  194. 9
  195. 10
  196. 11
  197. 12
  198. 13
  199. 14
  200. 15
  201. 16
  202. 17
  203. 18
  204. 19
  205. 20
  206. 21
  207. 22
  208. 23
  209. 24
  210. 25
  211. 26
  212. 27
  213. 28
  214. 29
  215. 30
  216. 31
  217. 32
  218. 33
  219. 34
  220. 35
  221. 36
  222. 37
  223. 38
  224. 39
  225. 40
  226. 41
  227. 42
  228. 43
  229. 44
  230. 45
  231. 46
  232. 47
  233. 48
  234. 49
  235. 50
  236. 51
  237. 52
  238. 53
  239. 54
  240. 55
  241. 56
  242.  
  243. -- part contents for background part 1
  244. ----- text -----
  245. Quadratic Roots
  246. #A
  247. x-y
  248. '2
  249. √∑
  250. Rup
  251. Sto
  252. '1
  253. √∑
  254. chs
  255. E
  256. E
  257. *
  258. Rup
  259. Rcl
  260. '1
  261. √∑
  262. -
  263. <->
  264. abs
  265. ‚àö
  266. Sto
  267. '1
  268. +
  269. E
  270. '2
  271. Rcl
  272. '1
  273. *
  274. -
  275. R/S
  276.  
  277. ____________
  278. Finds roots of
  279. ax^2 + bx + c
  280.  
  281. Procedure:
  282. Enter a
  283. Enter b
  284. Enter c
  285. Click [ A ]
  286. Read x1 in y reg
  287. Read x2 in x reg
  288. If value in big register is < 0 then roots are imaginary
  289.  
  290.  
  291.  
  292. -- part contents for card part 8
  293. ----- text -----
  294. X